package bookManager.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;



import bookManager.po.Book;
import bookManager.service.BookManager;
import bookManager.serviceImpl.BookManagerImpl;
import fwk.Controller;
import fwk.impl.ModelAndView;

public class ShowBooks implements Controller{
	BookManager bookManager=new BookManagerImpl();
	@Override
	public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) {
		// TODO Auto-generated method stub
		List<Book> bks=bookManager.findAllBooks();
//		System.out.println(2);
		Map<String, Object> map=new HashMap<String ,Object>();
		map.put("bks", bks);
		
		ModelAndView mv= new ModelAndView("listAllBooks",map);
		
		return mv;
	}

}
